Skip to main content
POST
/
v1
/
axons
/
{id}
/
publish
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const publishResultView = await client.axons.publish('id', {
  event_type: 'event_type',
  origin: 'EXTERNAL_EVENT',
  payload: 'payload',
  source: 'source',
});

console.log(publishResultView.sequence);
{
  "sequence": 123,
  "timestamp_ms": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The axon identifier.

Body

application/json
source
string
required

The source of the event (e.g. github, slack).

event_type
string
required

The event type (e.g. push, pull_request).

origin
enum<string>
required

Event origin.

Available options:
EXTERNAL_EVENT,
AGENT_EVENT,
USER_EVENT
payload
string
required

Event payload.

Response

200 - application/json

OK

sequence
integer<int64>
required

Assigned sequence number.

timestamp_ms
integer<int64>
required

Timestamp in milliseconds since epoch.